package com.haiyou.data.common.persister.mysql.help.invoke;

import java.util.Objects;

import com.haiyou.common.entity.Entity;
import com.haiyou.data.common.persister.mysql.help.ColumnHelper;
import com.haiyou.data.common.persister.mysql.meta.ColumnMeta;



public class CustomHelper implements InvokeHelper {

	@Override
	public void invoke(ColumnMeta columnMeta, Object ov, Entity<?> entity) {
		if (!Objects.isNull(ov)) {
			try {
				ColumnHelper.getSetter(columnMeta).invoke(entity, ov.toString());
			} catch (Exception e) {
				throw new RuntimeException(e.getMessage() + ":" + ov + ",\n" + entity + ",\n" + columnMeta, e);
			}
		}
	}

}
